from .relys import BitSet
from .relys import Chip

class BUS(Chip):
    def __init__(self, width):
        super().__init__(width, [0,width], [0,width])

@BUS.keyframe(0)
def _frame(chip):
    chip._ref(0)
    return chip

@BUS.keyframe(-1)
def _frame(chip):
    return chip

if __name__ == "__main__":
    bus = BUS(8)
    for i in range(10):
        bus.pinIN(i)
        bus.update(i)
        print(bus)
